<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>openWindow</title>
</head>
<script type="text/javascript" src="jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="layer.js"></script>

<body>
	<div class="innerwra">inner page.......</div>
	<button id="openWd">dddd</button>
	<script type="text/javascript">
	var openWd=function(){
		openWindow({
			title: "选择菜单",
            area: ['300px', '450px']
		})
	}

	// document.getElementById('openWd').addEventListener('click',function(){
	// 	openWd()
	// })
	window.openWindow = function (options) {
	    var globalParams = {
	        skin: 'layui-layer-molv',//皮肤
	        title: '标题',//标题
	        type: 1,//打开窗口的类型 1：html里的div内容 2：iframe方式，页面的路径
	        closeBtn: 1, //关闭按钮的形状 0、1
	        anim: -1,
	        isOutAnim: false,
	        shadeClose: false,
	        area: ['90%', '95%'],
	        content: '',
	        btn: false, //按钮
	        top: false //窗口弹出是否在iframe上层
	    };
	    globalParams = $.extend(globalParams, options);
	    if (globalParams.top) {
	        parent.layer.open(globalParams);
	    } else {
	        layer.open(globalParams);
	    }
	};
	$(function(){
		// openWindow({
  //               type: 2,
  //               title: '选取图标',
  //               area: ['1030px', '500px'],
  //               content: ['icon.html'],
  //               btn: false
  //           });
  		
  			openWindow({
  				type:2,
				title: "选择菜单",
	            area: ['800px', '450px'],
	            content: ['icon.html']
			})
  		
	})
	
	</script>
</body>
<style type="text/css">
html{
	height:100%;
	
}
body{
	height:calc(100% - 16px);
	background-color:yellowgreen;
}
</style>
</html>